<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  
    
      
    

    
  

  

  
    
      
    

    
  

  
    
      
    

    
  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic|Roboto Slab:300,300italic,400,400italic,700,700italic|Lobster Two:300,300italic,400,400italic,700,700italic|PT Mono:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="PHP,Yii2,awesome-php,awesome-yii2," />





  <link rel="alternate" href="/atom.xml" title="Ewan's Blog" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1" />






<meta name="description" content="Yii2 干货集。 Sites 网站 yiifeed：Yii 最新动态都在这里 yiigist：Yii 专用的 Packages my-yii：Yii 学习资料和新闻 YiiPowered：用 Yii 开发的项目案例，包括开源不开源的，包括 Yii1 和 Yii2，到目前为止有300多个案例了。 Yii2 学习小专栏：forecho 开的付费小专栏，欢迎有需要的朋友订阅。  Docs 文档 Yii">
<meta name="keywords" content="PHP,Yii2,awesome-php,awesome-yii2">
<meta property="og:type" content="article">
<meta property="og:title" content="awesome-yii2">
<meta property="og:url" content="http://www.iooeo.com/2018/04/10/awesome-yii2/index.html">
<meta property="og:site_name" content="Ewan&#39;s Blog">
<meta property="og:description" content="Yii2 干货集。 Sites 网站 yiifeed：Yii 最新动态都在这里 yiigist：Yii 专用的 Packages my-yii：Yii 学习资料和新闻 YiiPowered：用 Yii 开发的项目案例，包括开源不开源的，包括 Yii1 和 Yii2，到目前为止有300多个案例了。 Yii2 学习小专栏：forecho 开的付费小专栏，欢迎有需要的朋友订阅。  Docs 文档 Yii">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2018-04-10T03:20:41.361Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="awesome-yii2">
<meta name="twitter:description" content="Yii2 干货集。 Sites 网站 yiifeed：Yii 最新动态都在这里 yiigist：Yii 专用的 Packages my-yii：Yii 学习资料和新闻 YiiPowered：用 Yii 开发的项目案例，包括开源不开源的，包括 Yii1 和 Yii2，到目前为止有300多个案例了。 Yii2 学习小专栏：forecho 开的付费小专栏，欢迎有需要的朋友订阅。  Docs 文档 Yii">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"always","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://www.iooeo.com/2018/04/10/awesome-yii2/"/>





  <title>awesome-yii2 | Ewan's Blog</title>
  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?cea7ef9cbfe59c235bbe4bb0db874f5b";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>










</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Ewan's Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">Ewan's Blog | 杨依园技术博客 | 专注于PHP，涉及MySQL，Linux，Web，Nginx，Apache，Phalcon，Laravel，Redis，PostgreSql，Composer，Beanstalkd，Swoole</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-php">
          <a href="/categories/PHP/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-paper-plane"></i> <br />
            
            php
          </a>
        </li>
      
        
        <li class="menu-item menu-item-yii">
          <a href="/categories/PHP/Yii2/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-star"></i> <br />
            
            Yii2
          </a>
        </li>
      
        
        <li class="menu-item menu-item-swoole">
          <a href="/categories/PHP/Swoole/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-rocket"></i> <br />
            
            swoole
          </a>
        </li>
      
        
        <li class="menu-item menu-item-python">
          <a href="/categories/python/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-space-shuttle"></i> <br />
            
            python
          </a>
        </li>
      
        
        <li class="menu-item menu-item-awesome">
          <a href="/categories/awesome/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-dashboard"></i> <br />
            
            awesome
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off"
             placeholder="搜索..." spellcheck="false"
             type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="http://www.iooeo.com/2018/04/10/awesome-yii2/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Ewan">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Ewan's Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">awesome-yii2</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-04-10T11:17:30+08:00">
                2018-04-10
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/awesome/" itemprop="url" rel="index">
                    <span itemprop="name">awesome</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
              <span class="post-meta-divider">|</span>
              <span class="post-meta-item-icon">
                <i class="fa fa-comment-o"></i>
              </span>
              
                <a href="/2018/04/10/awesome-yii2/#SOHUCS" itemprop="discussionUrl">
                  <span id="changyan_count_unit" class="post-comments-count hc-comment-count" data-xid="2018/04/10/awesome-yii2/" itemprop="commentsCount"></span>
                </a>
              
            
          

          
          
             <span id="/2018/04/10/awesome-yii2/" class="leancloud_visitors" data-flag-title="awesome-yii2">
               <span class="post-meta-divider">|</span>
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               
                 <span class="post-meta-item-text">阅读次数 </span>
               
                 <span class="leancloud-visitors-count"></span>
             </span>
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>Yii2 干货集。</p>
<h2 id="Sites-网站"><a href="#Sites-网站" class="headerlink" title="Sites 网站"></a>Sites 网站</h2><ul>
<li><a href="http://yiifeed.com/" target="_blank" rel="noopener">yiifeed</a>：Yii 最新动态都在这里</li>
<li><a href="https://yiigist.com/" target="_blank" rel="noopener">yiigist</a>：Yii 专用的 Packages</li>
<li><a href="https://www.my-yii.com/" target="_blank" rel="noopener">my-yii</a>：Yii 学习资料和新闻</li>
<li><a href="http://yiipowered.com/en" target="_blank" rel="noopener">YiiPowered</a>：用 Yii 开发的项目案例，包括开源不开源的，包括 Yii1 和 Yii2，到目前为止有300多个案例了。</li>
<li><a href="https://xiaozhuanlan.com/yiier" target="_blank" rel="noopener">Yii2 学习小专栏</a>：forecho 开的付费小专栏，欢迎有需要的朋友订阅。</li>
</ul>
<h2 id="Docs-文档"><a href="#Docs-文档" class="headerlink" title="Docs 文档"></a>Docs 文档</h2><ul>
<li><a href="http://www.yiiframework.com/doc-2.0/index.html" target="_blank" rel="noopener">Yii Framework 2.0 类参考手册</a></li>
<li><a href="http://www.yiiframework.com/doc-2.0/guide-index.html" target="_blank" rel="noopener">Yii Framework 2.0 权威指南</a></li>
<li><a href="http://stuff.cebe.cc/yii2docs/" target="_blank" rel="noopener">Yii Framework 2.0 权威指南镜像</a>（每次github有提交时15分钟后自动更新比官方那个及时）</li>
<li><a href="http://stuff.cebe.cc/yii2-guide.pdf" target="_blank" rel="noopener">PDF 版本的权威指南</a></li>
<li><a href="https://github.com/yiisoft/yii2/tree/master/docs/guide-zh-CN" target="_blank" rel="noopener">Yii Framework 2.0 中文权威指南 </a></li>
<li><a href="https://github.com/yii2-chinesization/yii2-zh-cn" target="_blank" rel="noopener">Yii2 官方文档及其他文本的中文本土化项目</a></li>
<li><a href="https://github.com/samdark/yii2-cookbook" target="_blank" rel="noopener">yii2-cookbook</a></li>
<li><a href="http://www.tutorial-zoo.com/yii-2" target="_blank" rel="noopener">yii2-Cookbook 系列教程</a></li>
<li><a href="https://github.com/yiisoft/yii2-coding-standards" target="_blank" rel="noopener">yii2-coding-standards</a>：Yii2 代码标准检查</li>
<li><a href="http://dixonsatit.github.io/yii2-learning/" target="_blank" rel="noopener">yii2-learning</a>:是俄文的！但是可以看一下代码。</li>
</ul>
<h2 id="基于-Yii2-的开源程序"><a href="#基于-Yii2-的开源程序" class="headerlink" title="基于 Yii2 的开源程序"></a>基于 Yii2 的开源程序</h2><ul>
<li><a href="https://github.com/iiyii/getyii" target="_blank" rel="noopener">GetYii</a>：论坛</li>
<li><a href="https://github.com/DevGroup-ru/dotplant2" target="_blank" rel="noopener">dotplant2</a>：来自俄罗斯的电子商务CMS</li>
<li><a href="https://github.com/yincart2/galaxy" target="_blank" rel="noopener">yincart2</a>：电商星系系统，提供零售、批发、特卖、垂直电商、分销、O2O、C2C、移动电商、微信电商、社交电商、P2P、众筹等电商解决方案，根据需要选择不同的模块组合</li>
<li><a href="https://github.com/samdark/yii2-shop" target="_blank" rel="noopener">yii2-shop</a>：使用Yii 2.0实现简单商店的示例项目</li>
<li><a href="https://github.com/funson86/funshop" target="_blank" rel="noopener">funshop</a>：一个灵活的商城。</li>
<li><a href="https://github.com/callmez/huajuan" target="_blank" rel="noopener">huajuan</a>：Yii2 实现的问答,微信,文章系统 Demo</li>
<li><a href="https://github.com/djfly/dcms2" target="_blank" rel="noopener">dcms2</a>：yii2编写的cms</li>
<li><a href="https://github.com/mojifan/MoBlog" target="_blank" rel="noopener">MoBlog</a>：一个基于Yii2的博客系统</li>
<li><a href="https://github.com/noumo/easyii" target="_blank" rel="noopener">EasyiiCMS</a>：基于 Yii2 的 CMS 系统</li>
<li><a href="https://github.com/trntv/yii2-starter-kit" target="_blank" rel="noopener">yii2-starter-kit</a>：Yii2 开箱即用</li>
<li><a href="https://github.com/chonder/yunjianyi" target="_blank" rel="noopener">yunjianyi</a>：基于 Yii2 打造的 V2EX</li>
<li><a href="https://github.com/gromver/yii2-platform-basic" target="_blank" rel="noopener">yii2-platform-basic</a>：基于 Yii2  基础版打造的 CMS</li>
<li><a href="https://github.com/yiifans/lulucms2" target="_blank" rel="noopener">lulucms2</a> ：LuLu CMS2，模块化开发，集成强大的权限管理功能，非常适合二次开发</li>
<li><a href="https://github.com/hassiumsoft/hasscms-app" target="_blank" rel="noopener">hassiumsoft/hasscms-app</a>：基于 Yii2 开发的 一个现代的、轻量级的、可扩展的PHP CMS 系统。</li>
<li><a href="https://github.com/yiisoft-contrib/yiiframework.com" target="_blank" rel="noopener">yiisoft-contrib/yiiframework.com</a>：新版官网首页正在开发中</li>
<li><a href="https://github.com/githubjeka/angular-yii2" target="_blank" rel="noopener">githubjeka/angular-yii2</a>：yii2 restful + angular 实现前后端分离</li>
<li><a href="https://github.com/zephir/luya" target="_blank" rel="noopener">zephir/luya</a>：基于Yii2 CMS的编程框架。</li>
<li><a href="https://github.com/humhub/humhub" target="_blank" rel="noopener">humhub</a>：开源社交网络，以前说 Yii 1 现在迁移到 Yii2。</li>
<li><a href="https://github.com/daixianceng/xiaoego.com" target="_blank" rel="noopener">xiaoego.com</a>：xiaoego.com源码，校园O2O购物平台。</li>
<li><a href="https://github.com/yeesoft/yii2-yee-cms" target="_blank" rel="noopener">YeeCMS</a>：基于 Yii2 的 CMS，独到之处是借用 composer 安装卸载模块，你看看他的 <a href="https://github.com/yeesoft/yii2-yee-cms/blob/master/composer.json" target="_blank" rel="noopener">composer.json</a> 文件你就知道了。</li>
<li><a href="https://github.com/fancyecommerce/yii2_fecshop" target="_blank" rel="noopener">Fecshop</a> ：Fecshop 全称为 Fancy ECommerce Shop，是基于 PHP Yii2框架之上开发的一款优秀的开源电商系统。</li>
<li><a href="https://github.com/jamband/plusarchive.com" target="_blank" rel="noopener">jamband/plusarchive.com</a>：如果想在 Yii2 中使用 webpack，可以参考这个项目。</li>
</ul>
<h2 id="Module-模块"><a href="#Module-模块" class="headerlink" title="Module 模块"></a>Module 模块</h2><ul>
<li><a href="https://github.com/samdark/yii2-webshell" target="_blank" rel="noopener">yii2-webshell</a> 在 web 下运行shell</li>
<li><a href="https://github.com/zhuravljov/yii2-rest" target="_blank" rel="noopener">zhuravljov/yii2-rest</a> Yii2 REST 客户端</li>
<li><a href="https://github.com/mdmsoft/yii2-admin" target="_blank" rel="noopener">mdmsoft/yii2-admin</a> RBAC Manager 基于角色的权限管理</li>
<li><a href="https://github.com/dektrium/yii2-user" target="_blank" rel="noopener">yii2-user</a></li>
<li><a href="https://github.com/loveorigami/yii2-plugins-system" target="_blank" rel="noopener">yii2-plugins-system</a> Yii2 plugins system module with event manager and shortcodes as WordPress</li>
<li><a href="https://github.com/loveorigami/yii2-notification-wrapper" target="_blank" rel="noopener">yii2-notification-wrapper</a> Yii2-notification-wrapper module renders a message from session flash (with ajax, pjax support and etc.) through Growl, Noty, Toastr and more libraries</li>
<li><a href="https://github.com/funson86/yii2-setting" target="_blank" rel="noopener">yii2-setting</a>：常见的在后台设置,可以使用在任何地方</li>
<li><a href="https://github.com/callmez/yii2-wechat" target="_blank" rel="noopener">yii2-wechat</a>：基于Yii2实现的微信模块</li>
<li><a href="https://github.com/CostaRico/yii2-images" target="_blank" rel="noopener">CostaRico/yii2-images</a>：图片尺寸裁剪解决方案</li>
<li><a href="https://github.com/myweishanli/yii2-extjs-rbac" target="_blank" rel="noopener">myweishanli/yii2-extjs-rbac</a>：Yii2 ExtJs5 RBAC+ACL 权限管理系统</li>
<li><a href="https://github.com/bedezign/yii2-audit" target="_blank" rel="noopener">bedezign/yii2-audit</a>：记录和显示web/cli请求，数据库更改php/js错误和相关数据。</li>
<li><a href="https://github.com/Chiliec/yii2-vote" target="_blank" rel="noopener">Chiliec/yii2-vote</a>：提供点赞的模块</li>
<li><a href="https://github.com/codemix/yii2-bs3activeform" target="_blank" rel="noopener">codemix/yii2-bs3activeform</a> :Yii2 表单增强模块，有<a href="http://codemix.github.io/yii2-bs3activeform/index.html" target="_blank" rel="noopener">在线 Demo</a>。</li>
</ul>
<h2 id="Widgets-小部件"><a href="#Widgets-小部件" class="headerlink" title="Widgets 小部件"></a>Widgets 小部件</h2><ul>
<li><a href="https://github.com/kop/yii2-scroll-pager" target="_blank" rel="noopener">kop/yii2-scroll-pager</a>：瀑布滚动翻页</li>
<li><a href="https://github.com/liyunfang/yii2-widget-linkpager" target="_blank" rel="noopener">yii2-widget-linkpager</a>：带分页大小的分页栏</li>
<li><a href="https://github.com/lichunqiang/yii2-ajaxform" target="_blank" rel="noopener">yii2-ajaxform</a>：通过ajax提交表单</li>
<li><a href="https://github.com/lichunqiang/yii2-sweet-submit" target="_blank" rel="noopener">lichunqiang/yii2-sweet-submit</a>：<a href="https://github.com/t4t5/sweetalert" target="_blank" rel="noopener">sweetalert</a>一个漂亮的弹出框</li>
<li><a href="https://github.com/bizley/yii2-content-tools" target="_blank" rel="noopener">bizley/yii2-content-tools</a>：Yii2 实现 <a href="http://getcontenttools.com/" target="_blank" rel="noopener">ContentTools</a> 编辑器</li>
<li><a href="https://github.com/bupy7/yii2-dynamic-fields" target="_blank" rel="noopener">bupy7/yii2-dynamic-fields</a>：表单动态增加行的组件（demo可以看<a href="http://formvalidation.io/examples/adding-dynamic-field/" target="_blank" rel="noopener">Adding dynamic field</a>）</li>
</ul>
<h2 id="Extension-扩展"><a href="#Extension-扩展" class="headerlink" title="Extension 扩展"></a>Extension 扩展</h2><ul>
<li><a href="https://github.com/yiisoft" target="_blank" rel="noopener">yiisoft</a>：Yii2 官方扩展</li>
<li><a href="http://demos.krajee.com/" target="_blank" rel="noopener">kartik-v</a>：kartik-v 高产合集</li>
<li><a href="http://yiiwheels.com/" target="_blank" rel="noopener">2amigos</a>：2amigos 团队高产合集</li>
<li><a href="https://github.com/yii2tech" target="_blank" rel="noopener">yii2tech</a>：yii2tech 团队合集</li>
<li><a href="http://wbraganca.com/yii2extensions" target="_blank" rel="noopener">wbraganca</a>：又一个扩展集合，包括收货地址、上传图片、动态嵌套表单、选择框、标签框、上传图片、视频等扩展，最重要的是有在线 demo 体验。</li>
<li><a href="https://github.com/udokmeci/yii2-beanstalk" target="_blank" rel="noopener">yii2-beanstalk</a>：beanstalk 队列</li>
<li><a href="https://github.com/yiisoft/yii2-imagine" target="_blank" rel="noopener">yii2-imagine</a>：图片处理，缩略图生成</li>
<li><a href="https://github.com/dcb9/yii2-yunpian" target="_blank" rel="noopener">yii2-yunpian</a>：一个基于 Yii2 的短信 SDK</li>
<li><a href="https://github.com/dcb9/yii2-qiniu" target="_blank" rel="noopener">yii2-qiniu</a>：集成七牛的 SDK</li>
<li><a href="https://github.com/idarex/pingpp-yii2" target="_blank" rel="noopener">pingpp-yii2</a>：Yii2 化 Ping++ SDK</li>
<li><a href="https://github.com/yii2tech/crontab" target="_blank" rel="noopener">crontab</a>：Yii2 定时任务</li>
<li><a href="https://github.com/liyunfang/yii2-contextmenu" target="_blank" rel="noopener">yii2-contextmenu</a>：Yii2 grid行右击操作</li>
<li><a href="https://github.com/daixianceng/yii2-smser" target="_blank" rel="noopener">yii2-smser</a>：国内短信扩展</li>
<li><a href="https://github.com/daixianceng/yii2-echarts" target="_blank" rel="noopener">yii2-echarts</a>：Yii2 ECharts扩展</li>
<li><a href="https://github.com/yiidoc/yii2-redactor" target="_blank" rel="noopener">yiidoc/yii2-redactor</a>：大名鼎鼎的 <a href="http://imperavi.com/redactor/" target="_blank" rel="noopener">Redactor</a> 在线编辑器  </li>
<li><a href="https://github.com/Hzhihua/yii2-dump" target="_blank" rel="noopener">Hzhihua/yii2-dump</a>：用命令行的方式自动对现有的数据库（SQL）生成数据库迁移（migrate）文件，内有预览图。</li>
<li><a href="https://github.com/jamband/yii2-schemadump" target="_blank" rel="noopener">jamband/yii2-schemadump</a>：用命令的方式对现有的数据库（SQL）生成数据库迁移（migrate）代码，内有 gif 演示。</li>
<li><a href="https://github.com/DenisOgr/yii2-cronjobs" target="_blank" rel="noopener">DenisOgr/yii2-cronjobs</a>：用系统计划任务来每分钟运行这个PHP计划任务，然后你程序的计划任务的调用就写在 cron 这个控制器里就可以了。</li>
<li><a href="https://github.com/trntv/yii2-aceeditor" target="_blank" rel="noopener">trntv/yii2-aceeditor</a>：Yii2 封装 <a href="https://ace.c9.io/" target="_blank" rel="noopener">ace 在线编辑器</a></li>
<li><a href="https://github.com/zelenin/yii2-semantic-ui" target="_blank" rel="noopener">zelenin/yii2-semantic-ui</a>：Yii2 封装 <a href="http://semantic-ui.com/" target="_blank" rel="noopener">Semantic UI</a></li>
<li><a href="https://github.com/yiier/yii2-backup" target="_blank" rel="noopener">yiier/yii2-backup</a>：通过命令备份数据库的扩展，可以添加到定时任务实现定时备份发送到 Email。</li>
<li><a href="https://github.com/yiier/yii2-aliyun-oss" target="_blank" rel="noopener">yiier/yii2-aliyun-oss</a>：基于官网 SDK 封装的 Yii2 使用阿里云OSS。</li>
<li><a href="https://github.com/yiier/yiier-return-url" target="_blank" rel="noopener">yiier/yiier-return-url</a>：登录之后自动跳转登录之前的页面。</li>
<li><a href="https://github.com/lichunqiang/yii2-swagger" target="_blank" rel="noopener">lichunqiang/yii2-swagger</a>：Yii2 结合 <a href="http://swagger.io/" target="_blank" rel="noopener">swagger</a> 让写 API 文档不再是难事。<a href="https://github.com/lichunqiang/yii2-swagger-demo" target="_blank" rel="noopener">Demo 地址</a></li>
<li><a href="https://github.com/boundstate/yii2-mailgun" target="_blank" rel="noopener">boundstate/yii2-mailgun</a>：mailgun 邮箱服务扩展。</li>
<li><a href="https://github.com/abhi1693/yii2-system-info" target="_blank" rel="noopener">abhi1693/yii2-system-info</a>：获取 Windows 或者 Linux 系统信息。</li>
<li><a href="https://github.com/imanilchaudhari/yii2-rrssb" target="_blank" rel="noopener">imanilchaudhari/yii2-rrssb</a>：分享到社交网络（主要是针对国外一些网站）。</li>
<li><a href="https://github.com/alexandernst/yii2-device-detect" target="_blank" rel="noopener">alexandernst/yii2-device-detect</a>：获取访问网站的设备信息。</li>
<li><a href="https://github.com/yiister/yii2-advanced-grid" target="_blank" rel="noopener">yiister/yii2-advanced-grid</a>：高级版的 grid，有<a href="http://yiister.ru/projects/advanced-grid" target="_blank" rel="noopener">在线 demo</a> 体验。</li>
<li><a href="https://github.com/hellowearemito/yii2-sentry" target="_blank" rel="noopener">hellowearemito/yii2-sentry</a>： 收集日志神器——<a href="https://getsentry.com/" target="_blank" rel="noopener">Sentry</a> 的 Yii2 扩展。</li>
<li><a href="https://github.com/zhuravljov/yii2-queue" target="_blank" rel="noopener">zhuravljov/yii2-queue</a>：有望成为官网异步扩展的队列</li>
</ul>
<h2 id="Themes-主题模板"><a href="#Themes-主题模板" class="headerlink" title="Themes 主题模板"></a>Themes 主题模板</h2><ul>
<li><a href="https://github.com/dmstr/yii2-adminlte-asset" target="_blank" rel="noopener">dmstr/yii2-adminlte-asset</a>：大名鼎鼎的 <a href="https://github.com/almasaeed2010/AdminLTE" target="_blank" rel="noopener">AdminLTE</a> 开源后台，我现在很多后台就用这个。配合<a href="http://www.getyii.com/topic/564" target="_blank" rel="noopener">Yii2 使用 AdminLTE 模板</a>教程使用更佳。</li>
<li><a href="https://github.com/yiister/yii2-adminlte" target="_blank" rel="noopener">yiister/yii2-adminlte</a>：AdminLTE 后台模板的另一个选择，有做简单的 widget 封装，<a href="http://adminlte.yiister.ru/" target="_blank" rel="noopener">在线体验地址</a></li>
<li><a href="https://github.com/yiister/yii2-gentelella" target="_blank" rel="noopener">yiister/yii2-gentelella</a>：Gentelella 后台模板，<a href="http://gentelella.yiister.ru/" target="_blank" rel="noopener">在线体验地址</a></li>
</ul>
<h2 id="Behaviors-行为"><a href="#Behaviors-行为" class="headerlink" title="Behaviors 行为"></a>Behaviors 行为</h2><ul>
<li><a href="https://github.com/creocoder/yii2-nested-sets" target="_blank" rel="noopener">creocoder/yii2-nested-sets</a>：无限极嵌套分类</li>
<li><a href="https://github.com/creocoder/yii2-taggable" target="_blank" rel="noopener">creocoder/yii2-taggable</a>：文章标签解决方案</li>
<li><a href="https://github.com/OmgDef/yii2-multilingual-behavior" target="_blank" rel="noopener">OmgDef/yii2-multilingual-behavior</a>：多语言文章解决方案</li>
<li><a href="https://github.com/creocoder/yii2-nested-sets" target="_blank" rel="noopener">creocoder/yii2-nested-sets</a>：嵌套，无限级分类</li>
</ul>
<h2 id="Helpers-助手"><a href="#Helpers-助手" class="headerlink" title="Helpers 助手"></a>Helpers 助手</h2><ul>
<li><a href="https://github.com/kartik-v/yii2-helpers" target="_blank" rel="noopener">kartik-v/yii2-helpers</a>：<a href="http://demos.krajee.com/helper-functions/html" target="_blank" rel="noopener">HTML</a> 和 <a href="http://demos.krajee.com/helper-functions/enum" target="_blank" rel="noopener">枚举</a>的 helper</li>
<li><a href="https://github.com/DevGroup-ru/yii2-tag-dependency-helper" target="_blank" rel="noopener">DevGroup-ru/yii2-tag-dependency-helper</a>：非常棒的缓存设计方法，具体实现可以参考 <a href="https://github.com/DevGroup-ru/dotplant2" target="_blank" rel="noopener">dotplant2</a> 代码。</li>
<li><a href="https://github.com/xinnianq/yii2-routes" target="_blank" rel="noopener">xinnianq/yii2-routes</a> ：获取yii2项目所有路由，方便权限控制</li>
</ul>
<h2 id="Posts-文章"><a href="#Posts-文章" class="headerlink" title="Posts 文章"></a>Posts 文章</h2><ul>
<li><a href="http://my.oschina.net/u/248080/blog?catalog=3273266" target="_blank" rel="noopener">Yii2 Day 1~7 系列文章</a> 文章不是非常深入，但是对初学者非常有用</li>
<li><a href="http://blog.hashsolutions.in/technology/yii2-need-know/" target="_blank" rel="noopener">Yii2 - What you need to know</a></li>
<li><a href="http://segmentfault.com/a/1190000002428574" target="_blank" rel="noopener">使用Yii2时遇到的实际问题</a></li>
<li><a href="http://www.digpage.com/" target="_blank" rel="noopener">深入理解 Yii2.0</a></li>
<li><a href="http://www.bsourcecode.com/yiiframework2/" target="_blank" rel="noopener">Bsourcecode Yii2.0 系列文章（英文）</a></li>
<li><a href="http://webtips.krajee.com/tag/yii/" target="_blank" rel="noopener">krajee Yii2.0 系列文章（英文）</a></li>
<li><a href="http://www.cnblogs.com/ganiks/tag/yii2/" target="_blank" rel="noopener">PHP开源框架Yii2系列</a>：有很多关于 Yii2 RESTful 的使用</li>
</ul>
<h2 id="Videos-视频"><a href="#Videos-视频" class="headerlink" title="Videos 视频"></a>Videos 视频</h2><ul>
<li><a href="http://www.imooc.com/view/404" target="_blank" rel="noopener">与《YII框架》不得不说的故事—基础篇</a>：讲的很基础，建议初学者过一遍</li>
<li><a href="http://www.imooc.com/view/440" target="_blank" rel="noopener">与《YII框架》不得不说的故事—高效篇</a>：主要讲了缓存和 Gii 的使用</li>
<li><a href="http://www.imooc.com/learn/467" target="_blank" rel="noopener">与《YII框架》不得不说的故事—安全篇</a>：主要讲了 XSS 和 CSRF 等</li>
<li><a href="http://www.imooc.com/learn/491" target="_blank" rel="noopener">与《YII框架》不得不说的故事—扩展篇</a>：主要讲了模块化、事件机制和行为还有依赖注入，话题越来越高级，很赞。</li>
<li><a href="http://www.imooc.com/learn/520" target="_blank" rel="noopener">与《YII框架》不得不说的故事—工具篇</a>：主要讲了Gii、Composer 还有 Yii2 Debug 工具。</li>
<li><a href="http://www.maiziedu.com/course/php/317-3140/" target="_blank" rel="noopener">yii框架入门</a></li>
<li><a href="http://v.youku.com/v_show/id_XODY4NDQ5NzA0.html?f=23331432&amp;from=y1.7-1.3" target="_blank" rel="noopener">深入理解 Yii2.0 视频</a></li>
<li><a href="https://www.youtube.com/watch?v=NMjA5N7kbEQ&amp;feature=youtu.be" target="_blank" rel="noopener">Yii2 Development Visualization - youtube</a> / <a href="http://v.youku.com/v_show/id_XODA4NTIyNjYw.html?from=y1.2-1-87.3.3-1.1-1-1-2" target="_blank" rel="noopener">三分钟看尽Yii2开发的三年历程 - 优酷</a></li>
<li><a href="https://www.youtube.com/playlist?list=PLRd0zhQj3CBmusDbBzFgg3H20VxLx2mkF" target="_blank" rel="noopener">Yii2 Lessons - youtube</a></li>
<li><a href="http://i.youku.com/weixistyle" target="_blank" rel="noopener">魏曦的 Yii2.0 视频教程</a> 与 <a href="https://github.com/michaelweixi/Yii2Blog" target="_blank" rel="noopener">源码 michaelweixi/Yii2Blog</a></li>
</ul>

      
    </div>

    <div>
      
        

      
    </div>

    <div align="center">
      
        <div class="copyright">
        <p><span>
        <b>本文地址：</b><a href="/2018/04/10/awesome-yii2/" title="awesome-yii2">http://www.iooeo.com/2018/04/10/awesome-yii2/</a><br/><b>转载请注明出处，谢谢！</b>
        </span></p>
        </div>
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="http://ogpq2zwg5.bkt.clouddn.com/WechatIMG15.jpeg" alt="Ewan WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="http://ogpq2zwg5.bkt.clouddn.com/WechatIMG16.jpeg" alt="Ewan Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/PHP/" rel="tag"># PHP</a>
          
            <a href="/tags/Yii2/" rel="tag"># Yii2</a>
          
            <a href="/tags/awesome-php/" rel="tag"># awesome-php</a>
          
            <a href="/tags/awesome-yii2/" rel="tag"># awesome-yii2</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/04/10/awesome-php/" rel="next" title="awesome-php">
                <i class="fa fa-chevron-left"></i> awesome-php
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/04/11/Nginx-主线版-1-13-12-发布，Bug-修复版本/" rel="prev" title="Nginx 主线版 1.13.12 发布，Bug 修复版本">
                Nginx 主线版 1.13.12 发布，Bug 修复版本 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <!-- JiaThis Button BEGIN -->
<div class="jiathis_style">
  <a class="jiathis_button_tsina"></a>
  <a class="jiathis_button_tqq"></a>
  <a class="jiathis_button_weixin"></a>
  <a class="jiathis_button_cqq"></a>
  <a class="jiathis_button_douban"></a>
  <a class="jiathis_button_renren"></a>
  <a class="jiathis_button_qzone"></a>
  <a class="jiathis_button_kaixin001"></a>
  <a class="jiathis_button_copy"></a>
  <a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank"></a>
  <a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" >
  var jiathis_config={
    hideMore:false
  }
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END -->

      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="SOHUCS"></div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.png"
               alt="Ewan" />
          <p class="site-author-name" itemprop="name">Ewan</p>
           
              <p class="site-description motion-element" itemprop="description">The more effort ,the more lucky</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/">
                <span class="site-state-item-count">138</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">19</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">40</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="http://resume.iooeo.com/" target="_blank" title="Resume">
                  
                    <i class="fa fa-fw fa-handshake-o"></i>
                  
                  Resume
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/u/2120563685" target="_blank" title="Weibo">
                  
                    <i class="fa fa-fw fa-weibo"></i>
                  
                  Weibo
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://github.com/yangyiyuan" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="mailto:654846126@qq.com" target="_blank" title="Email">
                  
                    <i class="fa fa-fw fa-envelope"></i>
                  
                  Email
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.firedata.cn/" target="_blank" title="Company">
                  
                    <i class="fa fa-fw fa-users"></i>
                  
                  Company
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://game.iooeo.com/" target="_blank" title="MyGame">
                  
                    <i class="fa fa-fw fa-gamepad"></i>
                  
                  MyGame
                </a>
              </span>
            
          
        </div>

        
        
          <div class="cc-license motion-element" itemprop="license">
            <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank">
              <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
            </a>
          </div>
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.firedata.cn/" title="在职-意静科技" target="_blank">在职-意静科技</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.xd.com/" title="曾供职-心动网络" target="_blank">曾供职-心动网络</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.mobase.cn/" title="曾供职-翼成科技" target="_blank">曾供职-翼成科技</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.blueberrytech.cn/base/" title="曾供职-蓝莓盈动" target="_blank">曾供职-蓝莓盈动</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://old.tumiaoya.com/" title="白宝冰-博客" target="_blank">白宝冰-博客</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.liuxiaojia.cc/" title="刘佳-博客" target="_blank">刘佳-博客</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.pythondev.org" title="曹帅军-博客" target="_blank">曹帅军-博客</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.dannisi.xin" title="李丹-博客" target="_blank">李丹-博客</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://xcx.iooeo.com/" title="Cow's Love 工作室" target="_blank">Cow's Love 工作室</a>
                </li>
              
            </ul>
          </div>
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Sites-网站"><span class="nav-number">1.</span> <span class="nav-text"><a href="#Sites-&#x7F51;&#x7AD9;" class="headerlink" title="Sites &#x7F51;&#x7AD9;"></a>Sites &#x7F51;&#x7AD9;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Docs-文档"><span class="nav-number">2.</span> <span class="nav-text"><a href="#Docs-&#x6587;&#x6863;" class="headerlink" title="Docs &#x6587;&#x6863;"></a>Docs &#x6587;&#x6863;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#基于-Yii2-的开源程序"><span class="nav-number">3.</span> <span class="nav-text"><a href="#&#x57FA;&#x4E8E;-Yii2-&#x7684;&#x5F00;&#x6E90;&#x7A0B;&#x5E8F;" class="headerlink" title="&#x57FA;&#x4E8E; Yii2 &#x7684;&#x5F00;&#x6E90;&#x7A0B;&#x5E8F;"></a>&#x57FA;&#x4E8E; Yii2 &#x7684;&#x5F00;&#x6E90;&#x7A0B;&#x5E8F;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Module-模块"><span class="nav-number">4.</span> <span class="nav-text"><a href="#Module-&#x6A21;&#x5757;" class="headerlink" title="Module &#x6A21;&#x5757;"></a>Module &#x6A21;&#x5757;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Widgets-小部件"><span class="nav-number">5.</span> <span class="nav-text"><a href="#Widgets-&#x5C0F;&#x90E8;&#x4EF6;" class="headerlink" title="Widgets &#x5C0F;&#x90E8;&#x4EF6;"></a>Widgets &#x5C0F;&#x90E8;&#x4EF6;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Extension-扩展"><span class="nav-number">6.</span> <span class="nav-text"><a href="#Extension-&#x6269;&#x5C55;" class="headerlink" title="Extension &#x6269;&#x5C55;"></a>Extension &#x6269;&#x5C55;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Themes-主题模板"><span class="nav-number">7.</span> <span class="nav-text"><a href="#Themes-&#x4E3B;&#x9898;&#x6A21;&#x677F;" class="headerlink" title="Themes &#x4E3B;&#x9898;&#x6A21;&#x677F;"></a>Themes &#x4E3B;&#x9898;&#x6A21;&#x677F;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Behaviors-行为"><span class="nav-number">8.</span> <span class="nav-text"><a href="#Behaviors-&#x884C;&#x4E3A;" class="headerlink" title="Behaviors &#x884C;&#x4E3A;"></a>Behaviors &#x884C;&#x4E3A;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Helpers-助手"><span class="nav-number">9.</span> <span class="nav-text"><a href="#Helpers-&#x52A9;&#x624B;" class="headerlink" title="Helpers &#x52A9;&#x624B;"></a>Helpers &#x52A9;&#x624B;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Posts-文章"><span class="nav-number">10.</span> <span class="nav-text"><a href="#Posts-&#x6587;&#x7AE0;" class="headerlink" title="Posts &#x6587;&#x7AE0;"></a>Posts &#x6587;&#x7AE0;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Videos-视频"><span class="nav-number">11.</span> <span class="nav-text"><a href="#Videos-&#x89C6;&#x9891;" class="headerlink" title="Videos &#x89C6;&#x9891;"></a>Videos &#x89C6;&#x9891;</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright" >
  
  &copy;  2013 - 
  <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Ewan</span>
  &nbsp;
  <span id="busuanzi_container_site_uv">
      <i class="fa fa-user-md"></i>
      本站访客数:<span id="busuanzi_value_site_pv"></span>
    </span>
</div>


<div class="powered-by">
  <span class="links-of-author-item">
    <a href="http://www.miitbeian.gov.cn/" target="_blank" title="备案号">
    沪ICP备17032516号-1
    </a>
  </span>
</div>

<div class="powered-by">
  <span class="links-of-author-item">
    <a href="https://github.com/yangyiyuan" target="_blank" title="GitHub">
    <i class="fa fa-github-alt"></i>
    GitHub
    </a>
  </span>
</div>

<div class="theme-info">
  <span class="links-of-author-item">
    <a href="http://www.iooeo.com/about/" target="_blank" title="杨依园">
    <i class="fa fa-fw fa-hand-o-right"></i>
    做一个有思想的开发者---杨依园
    </a>
  </span>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  





  




  
    <script type="text/javascript">
    (function(){
      var appid = 'cyt8r7gzu';
      var conf = 'a4830425918b568a51dfe3d835fd90db';
      var width = window.innerWidth || document.documentElement.clientWidth;
      if (width < 960) {
      window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>'); } else { var loadJs=function(d,a){var c=document.getElementsByTagName("head")[0]||document.head||document.documentElement;var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("charset","UTF-8");b.setAttribute("src",d);if(typeof a==="function"){if(window.attachEvent){b.onreadystatechange=function(){var e=b.readyState;if(e==="loaded"||e==="complete"){b.onreadystatechange=null;a()}}}else{b.onload=a}}c.appendChild(b)};loadJs("https://changyan.sohu.com/upload/changyan.js",function(){
        window.changyan.api.config({appid:appid,conf:conf})});
      }
    })();
    </script>
    <script type="text/javascript" src="https://assets.changyan.sohu.com/upload/plugins/plugins.count.js"></script>
  



  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
  <script>AV.initialize("ilQJ7Pnw4P9y1I1cQlaOoggK-gzGzoHsz", "uwSCLmjySIQiXUJHwkhc5XdT");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  

  

  

  

<script src="/live2dw/lib/L2Dwidget.min.js?0c58a1486de42ac6cc1c59c7d98ae887"></script><script>L2Dwidget.init({"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/"});</script></body>
</html>
